<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <title>待评价</title>
     <link rel="icon" href="assets/img/favicon.ico">

    <link rel="stylesheet" type="text/css" href="css/webbase.css" />
    <link rel="stylesheet" type="text/css" href="css/pages-seckillOrder.css" />
</head>

<body>
    
	<!--页面顶部白条条，由js动态加载-->
	<script type="text/javascript" src="plugins/jquery/jquery.min.js"></script>
	<div class="nav-bottom"></div>
    <script type="text/javascript">$(".nav-bottom").load("top.html");</script>

<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
	$("#service").hover(function(){
		$(".service").show();
	},function(){
		$(".service").hide();
	});
	$("#shopcar").hover(function(){
		$("#shopcarlist").show();
	},function(){
		$("#shopcarlist").hide();
	});

})
</script>
<script type="text/javascript" src="js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="js/plugins/jquery-placeholder/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="js/widget/nav.js"></script>
</body>
    <!--header-->
    <div id="account">
        <div class="py-container">
            <div class="yui3-g home">
                <!--左侧列表-->
                <div class="yui3-u-1-6 list">

                    <div class="person-info">
                        <div class="person-photo"><img src="img/_/photo.png" alt=""></div>
                        <div class="person-account">
                            <span class="name">{{userInfo.username}}</span>
                            <span class="safe">账户安全</span>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                     <div class="list-items">
                        <dl>
							<dt><i>·</i> 订单中心</dt>
							<dd ><a href="home-index.html"  >我的订单</a></dd>
							<dd><a href="home-order-pay.html" >待付款</a></dd>
							<dd><a href="home-order-send.html"  >待发货</a></dd>
							<dd><a href="home-order-receive.html" >待收货</a></dd>
							<dd><a href="home-order-evaluate.html"  class="list-active">待评价</a></dd>
						</dl>
						<dl>
							<dt><i>·</i> 我的中心</dt>
							<dd><a href="home-person-collect.html">我的收藏</a></dd>
							<dd><a href="home-person-footmark.html">我的足迹</a></dd>
						</dl>
						<dl>
							<dt><i>·</i> 物流消息</dt>
						</dl>
						<dl>
							<dt><i>·</i> 设置</dt>
							<dd><a href="home-setting-info.html">个人信息</a></dd>
							<dd><a href="home-setting-address.html"  >地址管理</a></dd>
							<dd><a href="home-setting-safe.html" >安全管理</a></dd>
						</dl>
                    </div>
                </div>
                <!--右侧主内容-->
                <div class="yui3-u-5-6 order-pay">
                    <div class="body">
                        <div class="table-title">
                            <table class="sui-table  order-table">
                                <tr>
                                    <thead>
                                        <th width="35%">宝贝</th>
                                        <th width="5%">单价</th>
                                        <th width="5%">数量</th>
                                        <th width="8%">商品操作</th>
                                        <th width="10%">实付款</th>
                                        <th width="10%">交易状态</th>
                                        <th width="10%">交易操作</th>
                                    </thead>
                                </tr>
                            </table>
                        </div>
                        <div class="order-detail">
                            <div class="choose-order">
                                <div class="sui-pagination pagination-large top-pages">
                                    <ul>
                                        <li class="prev"><a href="#" @click="prepage">上一页</a></li>

                                        <li class="next"><a href="#" @click="nextpage">下一页</a></li>
                                    </ul>
                                </div>
                            </div>
                            <div class="orders" v-for="(c,i) in pageResult.items" :key="i">
                                <!--order1-->
                                <div class="choose-title" >
                                    <label data-toggle="checkbox" class="checkbox-pretty ">
                                        <input type="checkbox" checked="checked"><span>{{ly.formatDate(c.createTime)}}　订单编号：{{c.orderId}}  店铺：哇哈哈 <a>和我联系</a></span>
                                    </label>
                                    <a class="sui-btn btn-info share-btn">分享</a>
                                </div>
                                <table class="sui-table table-bordered order-datatable">
                                    <tbody v-for="(m,n) in c.orderDetails" :key="n">
                                    <tr>
                                        <td width="35%" >
                                            <div class="typographic"><img :src="m.image" width="80px" height="80px"/>
                                                <a href="#" class="block-text">{{m.title}}</a>
                                                <span class="guige" v-for="(v,k) in JSON.parse(m.ownSpec)" :key="k">
                                                        {{v}}
                                                    </span>
                                            </div>
                                        </td>
                                        <td width="5%" class="center">
                                            <ul class="unstyled">
                                                <li class="o-price">¥{{ly.formatPrice(m.price+20000)}}</li>
                                                <li>{{ly.formatPrice(m.price)}}</li>
                                            </ul>
                                        </td>
                                        <td width="5%" class="center">{{m.num}}</td>
                                        <td width="8%" class="center">

                                        </td>
                                        <td width="10%" class="center" >
                                            <ul class="unstyled">
                                                <li>¥{{ly.formatPrice(m.price)*m.num}}</li>
                                                <li>（含运费：￥0.00）</li>
                                            </ul>
                                        </td>
                                        <!--1-->
                                        <td width="10%" class="center" v-show="c.status===1">
                                            <ul class="unstyled">
                                                <li>等待买家付款</li>
                                                <li><a  href="#" class="btn"  @click="queryOrderDetail(c.orderId)">订单详情 </a></li>
                                            </ul>
                                        </td>
                                        <td width="10%" class="center" v-show="c.status===1">
                                            <ul class="unstyled">
                                                <li><a href="#" class="sui-btn btn-info">立即付款</a></li>
                                                <li>取消订单</li>
                                            </ul>
                                        </td>
                                        <!--2-->
                                        <td width="10%" class="center" v-show="c.status===2">
                                            <ul class="unstyled">
                                                <li>等待卖家发货</li>
                                                <li><a href="#"  @click="queryOrderDetail(c.orderId)" class="btn">订单详情 </a></li>
                                            </ul>
                                        </td>
                                        <td width="10%" class="center" v-show="c.status===2">
                                            <ul class="unstyled">
                                                <li><a href="#" class="sui-btn btn-info">提醒发货</a></li>
                                                <li>取消订单</li>
                                            </ul>
                                        </td>
                                        <!--3-->
                                        <td width="10%" class="center" v-show="c.status===3">
                                            <ul class="unstyled">
                                                <li>待收货</li>
                                                <li><a  href="#" @click="queryOrderDetail(c.orderId)" class="btn">订单详情 </a></li>
                                            </ul>
                                        </td>
                                        <td width="10%" class="center" v-show="c.status===3">
                                            <ul class="unstyled">
                                                <li><a href="#" class="sui-btn btn-info">确认收货</a></li>
                                                <li>取消订单</li>
                                            </ul>
                                        </td>
                                        <!--4-->
                                        <td width="10%" class="center" v-show="c.status===4">
                                            <ul class="unstyled">
                                                <li>待评价</li>
                                                <li><a href="#"  @click="queryOrderDetail(c.orderId)" class="btn">订单详情 </a></li>
                                            </ul>
                                        </td>
                                        <td width="10%" class="center" v-show="c.status===4">
                                            <ul class="unstyled">
                                                <li><a href="#" class="sui-btn btn-info">立即评价</a></li>
                                                <li>取消订单</li>
                                            </ul>
                                        </td>
                                    </tr>


                                    </tbody>
                                </table>

                            </div>
                            <div class="choose-order">
                                <div class="sui-pagination pagination-large top-pages">
                                    <ul>
                                        <li :class="{prev:true,disabled:search.page===1}"><a href="#" @click="prepage">«上一页</a></li>
                                        <li :class="{active:index(i)===search.page}" v-for="i in Math.min(5,pageResult.totalPage)">
                                            <a href="#" @click="search.page=index(i)">{{index(i)}}</a>
                                        </li>
                                        <li class="dotted" v-show="pageResult.totalPage>5"><span>...</span></li>
                                        <li :class="{next:true,disabled:search.page===pageResult.totalPage}"><a href="#" @click="nextpage">下一页»</a></li>
                                    </ul>
                                    <div><span>共{{pageResult.totalPage}}页&nbsp;</span><span>
                                            到
                                            <input type="text" v-model="jumppage" class="page-num"><button class="page-confirm" @click="jump">确定</button>
                                            页</span></div>
                                </div>
                            </div>

                            <div class="clearfix"></div>
                        </div>

                        <div class="like-title">
                            <div class="mt">
                                <span class="fl"><strong>热卖单品</strong></span>
                            </div>
                        </div>
                        <div class="like-list">
                            <ul class="yui3-g">
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="img/_/itemlike01.png" />
                                        </div>
                                        <div class="attr">
                                            <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                        </div>
                                        <div class="price">
                                            <strong>
											<em>¥</em>
											<i>3699.00</i>
										</strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有6人评价</i>
                                        </div>
                                    </div>
                                </li>
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="img/_/itemlike02.png" />
                                        </div>
                                        <div class="attr">
                                            <em>Apple苹果iPhone 6s/6s Plus 16G 64G 128G</em>
                                        </div>
                                        <div class="price">
                                            <strong>
											<em>¥</em>
											<i>4388.00</i>
										</strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有700人评价</i>
                                        </div>
                                    </div>
                                </li>
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="img/_/itemlike03.png" />
                                        </div>
                                        <div class="attr">
                                            <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                        </div>
                                        <div class="price">
                                            <strong>
											<em>¥</em>
											<i>4088.00</i>
										</strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有700人评价</i>
                                        </div>
                                    </div>
                                </li>
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="img/_/itemlike04.png" />
                                        </div>
                                        <div class="attr">
                                            <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                        </div>
                                        <div class="price">
                                            <strong>
											<em>¥</em>
											<i>4088.00</i>
										</strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有700人评价</i>
                                        </div>
                                    </div>
                                </li>

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<script src="./js/vue/vue.js"></script>
<script src="./js/axios.min.js"></script>
<script src="./js/common.js"></script>
<script type="text/javascript">
    var accountVm = new Vue({
        el:"#account",
        data:{
            ly,
            pageResult:{
                items:[],
                total:0,
                totalPage:0
            },
            userInfo:{
                id:0,
                username:''
            },
            search:{
                page:1,
                rows:5,
                status:0
            },
            key:null,
            jumppage:1,
            pp:null
        },
        methods:{
            loadorders(userInfo){
                ly.http.get("/order/list?page="+this.search.page+"&rows="+this.search.rows+"&status=4").then(resp=>{
                    this.pageResult=resp.data;
                })
            },
            prepage(){
                if (this.search.page>1) {
                    this.search.page--;
                }
            },nextpage(){
                if (this.search.page<this.pageResult.totalPage) {
                    this.search.page++;
                }
            },index(i) {
                if (this.search.page <= 3 || this.totalPage <= 5) {
                    // 当前页小于3，则页码就是从 i 开始
                    return i;
                } else if(this.search.page <= this.totalPage - 2) {
                    // 大于3，则从page-2开始，然后逐个加1
                    return this.search.page - 3 + i;
                } else{
                    return this.totalPage - 5 + i;
                }
            },
            jump(){
                this.search.page=this.jumppage
            },
            queryOrderDetail(orderId){
                //查询订单详情
                window.location ="/home-orderDetail.html?orderId="+orderId;
            }
        },
        created(){
            ly.http.get("/auth/verify").then(resp => {
                this.userInfo = resp.data;
                this.loadorders(this.userInfo);
            });

        },
        watch:{
            search: {//监视search属性的变化
                deep:true,
                handler(){
                    //变化后的回调函数
                    this.loadorders(this.userInfo)
                }
            }
        },
        components:{
            shortcut: () => import("/js/pages/shortcut.js")
        },

    });
</script>
	<!-- 底部栏位 -->
	<!--页面底部，由js动态加载-->
	<div class="clearfix footer"></div>
	<script type="text/javascript">$(".footer").load("foot.html");</script>
	<!--页面底部END-->

</html>